ConfigManager.messageSpeed = 3;
//ConfigManager.gameSpeed = 3;
ConfigManager.characterShaddow = true;
ConfigManager.animatedMap = true;
//ConfigManager.battleCamera = true;
ConfigManager.animatedEnemy = true;
ConfigManager.damageStyle = true;  //true:现代
ConfigManager.enemySort = true;  //true:等级排序
ConfigManager.language = false; //false：简体
ConfigManager.fullscreen= false;
ConfigManager.vbOn = Utils.isMobileDevice();
ConfigManager.vbRockerFix = true;
ConfigManager.vbCoexistTouch = true;
ConfigManager.rumbleOption = true;

// 保存
let _ConfigManager_makeData = ConfigManager.makeData;
ConfigManager.makeData = function() {
  var config = _ConfigManager_makeData.call(this);

  config.messageSpeed = this.messageSpeed;
  config.characterShaddow = this.characterShaddow;
  config.animatedMap = this.animatedMap;
  //config.battleCamera = this.battleCamera;//yep插件设置过了
  config.animatedEnemy = this.animatedEnemy;
  config.damageStyle = this.damageStyle;
  config.enemySort = this.enemySort;
  config.fullscreen = this.fullscreen;
  config.language = this.language;
  config.vbOn = this.vbOn;
  config.vbRockerFix = this.vbRockerFix;
  config.vbCoexistTouch = this.vbCoexistTouch;
  config.rumble = this.rumbleOption;
  return config;
};

// 读取
let _ConfigManager_applyData = ConfigManager.applyData;
ConfigManager.applyData = function(config) {
  _ConfigManager_applyData.call(this, config);
  this.messageSpeed = this.readConfigMessageSpeed(config, 'messageSpeed');
  this.characterShaddow = this.readOtherFlag(config, 'characterShaddow');
  this.animatedMap = this.readOtherFlag(config, 'animatedMap');
  //this.battleCamera = this.readFlag(config, 'battleCamera');//yep插件设置过了
  this.damageStyle = this.readOtherFlag(config, 'damageStyle');
  this.enemySort = this.readOtherFlag(config, 'enemySort');
  this.animatedEnemy = this.readOtherFlag(config, 'animatedEnemy');
  this.language = this.readLanguage(config, 'language');
  this.vbOn = this.readLanguage(config, 'vbOn');
  this.vbRockerFix = this.readLanguage(config, 'vbRockerFix');
  this.vbCoexistTouch = this.readLanguage(config, 'vbCoexistTouch');
  this.rumbleOption = this.readOtherFlag(config, 'rumble');
  this.fullscreen = this.readOtherFlag(config,'fullscreen')
};


ConfigManager.readLanguage = function(config, name) {
  var value = config[name];
  if (value !== undefined) {
      return value;
  } else {
      return false; //默认简体
  }
};
// 角色阴影、地图动态、敌人动态、手柄震动
ConfigManager.readOtherFlag = function(config, name) {
  var value = config[name];
  if (value !== undefined) {
      return value;
  } else {
      return true;
  }
};

ConfigManager.readConfigMessageSpeed = function(config, name) {
  var value = config[name];
  if (value !== undefined) {
      return value;
  } else {
      return 3;
  }
};

ConfigManager.readConfigGameSpeed = function(config, name) {
    var value = config[name];
    if (value !== undefined) {
        return value;
    } else {
        return 3;
    }
  };